<?php

use yii\helpers\Html;
use yii\helpers\Url;

/* @var $this yii\web\View */
/* @var $model common\models\Page */

$this->title = $model['title'] . ' - ' . Yii::$app->params['site_name'];
$title = $model['title'];
//$this->params['breadcrumbs'][] = ['label' => Yii::t('common', 'Pages'), 'url' => ['index']];
$this->params['breadcrumbs'][] = $title;
$this->registerMetaTag(['name' => 'keywords', 'content' => $model['title']]);
$this->registerMetaTag(['name' => 'description', 'content' => $model['description']]);
?>
<div class="page-view row">
    <div class="col-md-8 br10 white">
        <h1><span class="attr red"><i class="iconfont fs20">&#xe62b;</i></span><?= Html::encode($title); ?></h1>
        <p>
            <span class="attr" title="作者"><i class="iconfont">&#xe630;</i><?= $model['author']; ?></span>
            <span class="attr" title="日期"><i class="iconfont">&#xe6f0;</i><?= date('Y-m-d: H:i:s', $model['updated_at']); ?></span>
        </p>
        <p><?= $model['content'] ?></p>
    </div>
    <div class="col-md-4 br10 white">
        <div class="row widget">
            <div class="col-md-12">
                <h2 class="widget_title"><small><i class="iconfont">&#xe647;</i>热门推荐</small></h2>
                <hr>
                <?php
                foreach ($hot as $value) {
                    echo '<p class="article"><i class="iconfont fs20">&#xe89d;</i>';
                    echo Html::a($value['title'], Url::to('/topic/' . $value['id']));
                    echo '</p>';
                }
                ?>
            </div>
        </div>
        <div class="row widget">
            <div class="col-md-12">
                <h2 class="widget_title"><small><i class="iconfont">&#xe60d;</i>标签聚合</small></h2>
                <hr>
                <?php
                foreach ($tag as $value) {
                    echo '<span class="widget-tag">';
                    echo Html::a($value['tag'], Url::to('/topic/' . $value['tag']), ['title' => $value['tag'], 'class' => 'btn btn-default', 'role' => 'button']);
                    echo '</span>';
                }
                ?>
            </div>
        </div>        
    </div>
</div>
